<?php

namespace App\Service\Kms\Common;

use Illuminate\Support\Carbon;

class DateService
{
    /**
     * @param int $timestamp
     * @return array
     */
    public static function translateDate(int $timestamp): array
    {
        $weekDay        = Carbon::createFromTimestamp($timestamp)->weekday();
        $weekDayCnGroup = [
            "星期一",
            "星期二",
            "星期三",
            "星期四",
            "星期五",
            "星期六",
            "星期日",
        ];
        return [
            "timestamp" => $timestamp,
            "weekDay"   => $weekDay,
            "weekDayCn" => $weekDayCnGroup[$weekDay]
        ];
    }
}
